refactor suggested by @knu

Andrew Cantino 10 年之前
父节点
当前提交
035097bf76
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      app/concerns/web_request_concern.rb

+ 1 - 1
app/concerns/web_request_concern.rb

@@ -9,7 +9,7 @@ module WebRequestConcern
9 9
       errors.add(:base, "user_agent must be a string") unless options['user_agent'].is_a?(String)
10 10
     end
11 11
 
12
-    if options['disable_ssl_verification'].present? && ![true, false, 'true', 'false'].include?(options['disable_ssl_verification'])
12
+    if options['disable_ssl_verification'].present? && boolify(options['disable_ssl_verification']).nil?
13 13
       errors.add(:base, "if provided, disable_ssl_verification must be true or false")
14 14
     end
15 15